using System;
using UnityEngine;
using UnityEngine.UI;

namespace CGF
{
    //该脚本自动生成或覆盖，不可编辑
    public partial class PanelRecharge
    {   
		public CButton BtnBack;
		public InputField InputField;
		public SwitchGroup Buttons;
		public CButton BtnConfirm;
		public Text Prefix;
		public Text Placeholder;
		public I18N i18n;

        public Reference reference { get; private set; }
        public Action onProsBindCompleted;
        
        public void BindProperties(Transform transform)
        {   
            reference = transform.GetComponent<Reference>();
            if(!reference)return;
            int nodeIndex = 0;
			BtnBack = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			InputField = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<InputField>();
			Buttons = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<SwitchGroup>();
			BtnConfirm = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			Prefix = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Text>();
			Placeholder = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Text>();
			i18n = transform.GetComponent<I18N>();
            onProsBindCompleted?.Invoke();
        }
        
        public void SetProsBindCompletedAction(Action action)
        {
            onProsBindCompleted = action;
        }

		public string I18N_please_input_amount { get { return i18n.GetTextByKey("please_input_amount"); } }
		public string I18N_recharge_success { get { return i18n.GetTextByKey("recharge_success"); } }
		public string I18N_amount_range { get { return i18n.GetTextByKey("amount_range"); } }
		public string I18N_can_not_less_min { get { return i18n.GetTextByKey("can_not_less_min"); } }
		public string I18N_can_not_above_max { get { return i18n.GetTextByKey("can_not_above_max"); } }
    }
}
